<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <link rel="stylesheet" href="styles/style.css">
        <link rel="stylesheet" href="styles/theme/atom-one-dark.css">
        <title>例子15-JS进阶（三）</title>
    </head>
    <body>
        <pre>
            <code>
                    // 例子15

                    var pattern1 = /\d{2,4}/; // 匹配2~4个数字
                    var pattern2 = /\w{3}\d?/; // 精确匹配三个单词和一个可选的数字
                    var pattern3 = /\s+java\s+/; // 匹配前后带有一个或多个空格的字符串“java”
            </code>
        </pre>
        <script src="scripts/libs/highlight.pack.js"></script>
        <script src="scripts/15.js"></script>
        <script>
            hljs.initHighlightingOnLoad();
        </script>
    </body>
</html>